package cn.wolfcode.crm.mapper;

import cn.wolfcode.crm.domain.Client;
import cn.wolfcode.crm.query.ClientQueryObject;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;

public interface ClientMapper {

    int deleteByPrimaryKey(Long id);

    int insert(Client record);

    Client selectByPrimaryKey(Long id);

    List<Client> selectAll();

    int updateByPrimaryKey(Client record);

    Integer selectBirCount(Date date);

    Integer selectBimCount(Map<String, Date> dates);

    Integer selectCount(ClientQueryObject qo);

    List<Client> queryByQo(ClientQueryObject qo);

    List<Client> selectForExport(ClientQueryObject qo);

    Client selectByName(String name);

    Client selectByNumber(String number);

    void updateBalance(@Param("id") Long id, @Param("afterBalance") BigDecimal afterBalance);

    void updateIntegral(Client client);

    Integer getCount();

    Client loginBysale(@Param("name") String name, @Param("password") String password);
}